You are here: Trading System Programming > Reference > Classes > TechnicalAnalysis > TechnicalAnalysis Methods > SAR

SAR

This method calculates the Parabolic SAR.

 

Syntax

var SAR(acceleration, maximum, highPricesArray, lowPricesArray, calculatedDataArray);

Parameters

acceleration

Acceleration floating value.

 

highPricesArray

Maximum floating value.

 

highPricesArray

Array object filled with high prices.

 

lowPricesArray

Array object filled with low prices.

 

calculatedDataArray

Empty Array object that will be filled with calculated data.

Return Value

Returns true if calculation was completed successfully, or false otherwise.

Example

The following example demonstrates how to use SAR method.

 

function calculate(beginIndex, endIndex)

{

var acceleration = 2.00;

var maximum = 1.00;

var highPricesArray = new Array();

var lowPricesArray = new Array();

 

//populate arrays..

..

..

..

 

var calculatedDataArray = new Array();

 

var rc = TechnicalAnalysis.SAR(period, highPricesArray, lowPricesArray, calculatedDataArray);

}

 

 


Copyright © 2006-2009 ActiveTick LLC